<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<base href="<%=basePath%>">
<%@include file="/esayuiStyle.jsp" %>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<script type="text/javascript">
	$(function(){
		$("#patientRechargeRecordTable").datagrid({
			pagination:true,
			toolbar:'#tb',
			idField:"id"
		})
	})
	function patientRRSetCondition(){
		var postData = {}; 
			postData["patient.id"] = $("#patient").val();
			postData["user.id"] = $("#user").val();
			postData["paymentMethod.id"] = $("#paymentMethod").val();
		$("#patientRechargeRecordTable").datagrid("reload",postData);
	}
	function patientFormatter(value,row,index){
		return row.patient.name;
	}
	
	function dictionaryFormatter(value,row,index){
		return row.paymentMethod.value;
	}
	function addPatientRR(){
		addDialog("添加充值记录",500,400,"patientrechargerecord/patientrrfrom","#patientRechargeRecordForm","patientrechargerecord/patientrradd","#patientRechargeRecordTable");
	}
</script>
<body>
<div id="tb">
	<form id="patientCondition">
		<label class="textbox-label textbox-label-left" for="patientid" style="text-align: left; height: 26px; margin-left:15px; width:35px; line-height: 26px;">病人:</label>
	    <input id="patient" class="easyui-combobox" name="patient.id" style="width:150px;" data-options=" 
		      url:'patient/patientall', 
		      valueField:'id', 
		      textField:'name', 
		      panelheight:'auto'
	     ">
	     <label class="textbox-label textbox-label-left" for="userid" style="text-align: left; height: 26px; margin-left:15px; width:35px; line-height: 26px;">用户:</label>
	    <input id="user" class="easyui-combobox" name="user.id" style="width:150px;" data-options=" 
		      url:'user/selectAll', 
		      valueField:'id', 
		      textField:'name', 
		      panelheight:'auto'
	     ">
	     <label class="textbox-label textbox-label-left" for="paymentMethodid" style="text-align: left; height: 26px; margin-left:15px; width:55px; line-height: 26px;">支付方式:</label>
	    <input id="paymentMethod" class="easyui-combobox" name="paymentMethod.id" style="width:150px;" data-options=" 
		      url:'dictionary/selectValueByKey', 
		      valueField:'id', 
		      textField:'value', 
		      panelheight:'auto',
		      labelposition: 'top',
			  queryParams: { key: 'zhifufangshi' }
	     ">

		<a id="btn" href="javaScript:void(0)" onclick="patientRRSetCondition();" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true">serch</a>
		<a href="javascript:void(0)" class="easyui-linkbutton" onclick="addPatientRR();" data-options="iconCls:'icon-add',plain:true">充值:</a>
	</form>
</div>
<table id="patientRechargeRecordTable" title="账户充值" 
    data-options="url:'patientrechargerecord/patientrrlist',fitColumns:true,striped:true,rownumbers:true">
    <thead>
		<tr>
			<th data-options="field:'asddsa',checkbox:true" ></th>
			<th data-options="field:'id',width:30,sortable:true,order:'desc'">Id</th>
			<th data-options="field:'patient',width:100,formatter:patientFormatter">patient</th>
			<th data-options="field:'user',width:100">user</th>
			<th data-options="field:'rechargeDate',width:200">rechargeDate</th>
			<th data-options="field:'money',width:100">money</th>
			<th data-options="field:'paymentMethod',width:100,formatter:dictionaryFormatter">paymentMethod</th>
			<th data-options="field:'remarks',width:100">remarks</th>
		</tr>
    </thead>
</table>
</body>
</html>